package com.lichuang.dedao.user.enums;

import lombok.Getter;

@Getter
public enum CollectionType {

    CURRICULUM(0,"课程"),
    LISTEN_BOOK(1,"听书"),
    BOOK_LIST(2,"书单"),
    SPECIAL(3,"专题");

    private Integer value;

    private String name;

    CollectionType(Integer value, String name){
        this.value = value;
        this.name = name;
    }

    public static CollectionType CollectionTypeOf(Integer value){
        for (int i = 0; i < CollectionType.values().length; i++) {
            if (CollectionType.values()[i].value == value){
                return CollectionType.values()[i];
            }
        }
        return null;
    }

}
